import threading
import time

list1=[]
def add_list():
    for i in range(10):
        list1.append(i)
        time.sleep(1)
        print(f'添加{i}')
    print(f'添加完成{list1}')

def read_list():
    print(list1)


if __name__ == '__main__':
    addlist=threading.Thread(target=add_list)
    readlist=threading.Thread(target=read_list)
    addlist.start()
    #添加join等待子线程处理完成再执行下一步操作
    addlist.join()
    readlist.start()